//定义返回值枚举类 
export enum CompareEnum {
    LESS = -1,
    BIGGER = 1,
    EQUALS = 0
}

export interface ICompareFunction {
    compare<T>(a: T, b: T): number
}

export class DefaultCompare implements ICompareFunction {
    compare<T>(a: T, b: T): number {
        if (a === b) {
            return CompareEnum.EQUALS
        } else if (a > b) {
            return CompareEnum.BIGGER
        } else {
            return CompareEnum.LESS
        }
    }
}